import React, { Component } from 'react'
import {BrowserRouter,Navigate,Route,Routes} from 'react-router-dom'
import Home from '../view/home'
import About from '../view/About'
export default class IndexRouter extends Component<any,any>{
  render() {
    return (
      <BrowserRouter>
        <Routes>
          <Route path='/home' element={<Home/>}></Route>
          <Route path='/about/:id' element={<About/>}></Route>
          {/* react-router-dom--v6废弃了Redirect重定向下发新写法如下 */}
          <Route path="/" element={<Navigate to="/home" />}/>
        </Routes>
      </BrowserRouter>
    )
  }
}
